#pragma once

#include "test.h"
#include "../CharInfo.h"

namespace cal
{
namespace test
{

TEST(CharInfoAPI)
{
    EXPECT_TRUE(is_identifier_start('_'));
    EXPECT_TRUE(is_identifier_start('a'));
    EXPECT_TRUE(is_identifier_start('A'));
    EXPECT_FALSE(is_identifier_start('.'));
    EXPECT_FALSE(is_identifier_start('\t'));
    EXPECT_FALSE(is_identifier_start(' '));
    EXPECT_FALSE(is_identifier_start('\n'));
    EXPECT_FALSE(is_identifier_start(']'));
    EXPECT_FALSE(is_identifier_start('\''));

    EXPECT_TRUE(is_identifier_continue('_'));
    EXPECT_TRUE(is_identifier_continue('Z'));
    EXPECT_TRUE(is_identifier_continue('z'));
    EXPECT_TRUE(is_identifier_continue('0'));
    EXPECT_TRUE(is_identifier_continue('9'));
    EXPECT_FALSE(is_identifier_continue('\t'));
    EXPECT_FALSE(is_identifier_continue(' '));
    EXPECT_FALSE(is_identifier_continue('\"'));

    EXPECT_TRUE(is_ignorable_white_space('\t'));
    EXPECT_TRUE(is_ignorable_white_space('\f'));
    EXPECT_TRUE(is_ignorable_white_space('\v'));
    EXPECT_TRUE(is_ignorable_white_space(' '));
    EXPECT_FALSE(is_ignorable_white_space('\r'));
    EXPECT_FALSE(is_ignorable_white_space('\n'));
    EXPECT_FALSE(is_ignorable_white_space('\0'));

    EXPECT_EQ("\\a", get_literal_string('\a'));
    EXPECT_EQ("\\f", get_literal_string('\f'));
    EXPECT_EQ("\\n", get_literal_string('\n'));
    EXPECT_EQ("\\t", get_literal_string('\t'));
    EXPECT_EQ("\\'", get_literal_string('\''));
    EXPECT_EQ("\\\"", get_literal_string('"'));
    EXPECT_EQ("\\0", get_literal_string('\0'));
    EXPECT_EQ("a", get_literal_string('a'));
}

}   // namespace test
}   // namespace cal
